package com.blogspot.dizpers.scribendi.core.manifest;

import java.util.jar.Attributes;
import java.util.jar.Manifest;

public class ManifestParser implements IManifestParser {
	
    private Manifestor manifestor = new Manifestor();

    public Manifestor getManifest() {
        return manifestor;
    }

    public void parse(Manifest manifest) {
        Attributes mainAttrs = manifest.getMainAttributes();
        manifestor.setAuthor(mainAttrs.getValue(IManifestParser.CREATED_BY));
        manifestor.setMainclass(mainAttrs.getValue(IManifestParser.MAIN_CLASS));
        manifestor.setPlugin(mainAttrs.getValue(IManifestParser.EXTENSION_NAME));
        manifestor.setVersion(mainAttrs.getValue(IManifestParser.MANIFEST_VERSION));
    }
}